]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[search] Fix activation of results from custom renderers
authorColin Walters <walters@verbum.org>
Thu, 4 Mar 2010 20:08:24 +0000 (15:08 -0500)
committerColin Walters <walters@verbum.org>
Thu, 4 Mar 2010 20:12:06 +0000 (15:12 -0500)
The previous commit broke activation when selecting an actor
from a custom renderer.  Fix this by explicitly defining a method
activateSelected on the search renderer.

js/ui/appDisplay.js
js/ui/dash.js
js/ui/search.js

index 1f6e442dd28fd81cd4e1a865f69e90c1a10b4c07..fdb2387ae916a4bfc76403a10e29215d6f7301fb 100644 (file)
@@ -251,6 +251,14 @@ AppSearchResultDisplay.prototype = {
         targetActor._delegate.setSelected(true);
         this.selectionIndex = index;
         return true;
+    },
+
+    activateSelected: function() {
+        if (this.selectionIndex < 0)
+            return;
+        let children = this._container.get_children();
+        let targetActor = children[this.selectionIndex];
+        this.provider.activateResult(targetActor._delegate.app.get_id())
     }
 }
 
index 81f63fd67ce0c41f3c1350d178276c466234c1d7..4082bcef7e06740a89d05740cb86279fd1f2a14d 100644 (file)
@@ -432,6 +432,12 @@ OverflowSearchResults.prototype = {
         targetActor._delegate.setSelected(true);
         this.selectionIndex = index;
         return true;
+    },
+
+    activateSelected: function() {
+        let children = this.actor.get_children();
+        let targetActor = children[this.selectionIndex];
+        targetActor._delegate.activate();
     }
 }
 
@@ -597,9 +603,8 @@ SearchResults.prototype = {
             return;
         let meta = this._providerMeta[current];
         let resultDisplay = meta.resultDisplay;
-        let children = resultDisplay.actor.get_children();
-        let targetActor = children[resultDisplay.getSelectionIndex()];
-        targetActor._delegate.activate();
+        resultDisplay.activateSelected();
+        Main.overview.hide();
     }
 }
 
index 2b738523c3a17878716f2ca234b300160b1b94c5..c25e02ded51ae570335e78373add8e9a04bc8da9 100644 (file)
@@ -80,6 +80,13 @@ SearchResultDisplay.prototype = {
      */
     selectIndex: function() {
         throw new Error("not implemented");
+    },
+
+    /**
+     * Activate the currently selected search result.
+     */
+    activateSelected: function() {
+        throw new Error("not implemented");
     }
 };